You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support DAE models (DFN, lead_acid.Full) in CellElectrical and CellElectrothermal - #22
Closes#18. With the reduced Jacobian, constraint tolerance and output function now in PathSim (0.27.1), the monolithic cell blocks are based on SemiExplicitDAE, so models with algebraic variables after discretisation (DFN, lead_acid.Full, LOQS on PyBaMM 26.7) no longer raise NotImplementedError and are integrated by PathSim's own solvers. ODE models such as SPMe take the same path without algebraic states; results are unchanged.
Changes
_CellBase derives from SemiExplicitDAE, passes the analytic CasADi Jacobians and computes the cell outputs and voltage cut-offs in func_out; only public PathSim API is used.
New tolerance parameter (default 1e-6) for the algebraic solve.
Requires pathsim>=0.27.1.
Tests: DAE-raises tests replaced by DFN and lead_acid.Full tests, including voltage comparisons against PyBaMM's own solver.
README: model compatibility table replaced by a short list, since all blocks now support all models. Notebook 03 updated accordingly.
Notes
600 s discharge at 5 A, final voltage vs PyBaMM: SPMe 3.8198/3.8198 V (0.6 s), DFN 3.8237/3.8237 V (73 s), lead_acid.Full 2.1301/2.1304 V (1.9 s).
The tolerance default is a compromise: lead_acid.Full stalls at 1e-7 and below due to ill-conditioned algebraic equations, while DFN runs about twice as fast at 1e-9.
Qualify compatibility claim for models missing required outputs
README.md:69
This compatibility claim is broader than the block API. Construction still resolves mandatory voltage/heating (and, for electrothermal, temperature) outputs via _resolve_output_vars; for example, PyBaMM's sodium_ion.BasicDFN has no Total heating [W] output, so CellElectrical raises instead of accepting it. Please qualify support to models exposing the selected block's required outputs.
Qualify documentation claim of universal PyBaMM model support
src/pathsim_batt/cells/pybamm_cell.py:719
The wrapper does not handle literally any PyBaMM model even if PyBaMM's solver can integrate it: _resolve_output_vars still requires voltage, heating, and SOC outputs. Qualify this statement so the public class documentation does not promise compatibility that construction rejects.
This issue also appears on line 755 of the same file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #18. With the reduced Jacobian, constraint tolerance and output function now in PathSim (0.27.1), the monolithic cell blocks are based on
SemiExplicitDAE, so models with algebraic variables after discretisation (DFN, lead_acid.Full, LOQS on PyBaMM 26.7) no longer raiseNotImplementedErrorand are integrated by PathSim's own solvers. ODE models such as SPMe take the same path without algebraic states; results are unchanged.Changes
_CellBasederives fromSemiExplicitDAE, passes the analytic CasADi Jacobians and computes the cell outputs and voltage cut-offs infunc_out; only public PathSim API is used.toleranceparameter (default 1e-6) for the algebraic solve.pathsim>=0.27.1.Notes